package com.itheima.thread.communication.demo01;

// 消费者线程的任务类
public class CustomerThread implements Runnable {

    private Box box ;
    public CustomerThread(Box box) {            // 定义接收奶箱的构造方法
        this.box = box ;
    }

    @Override
    public void run() {

        // 创建奶箱
        // Box box = new Box() ;

        // 消费者线程需要不断的消费奶
        while(true) {
            System.out.println(box.getMilkType() + "----" + box.getAmount());
        }

    }

}
